<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>成绩查询</title>
    <link rel="stylesheet" type="text/css" href="/layui/css/layui.css">
    <script src="/js/jquery.js"></script>
    <script src="/layuimoduls/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <table id="stuscore" lay-filter="test"></table>
    </div>
</div>
<script src="/layui/layui.js"></script>
<script>
    layui.use('table', function () {
        var table = layui.table;

        //第一个实例
        table.render({
            elem: '#stuscore'
            , url: '/queryScore1' //数据接口
            , method: 'post'
            , page: true //开启分页
            , cols: [
                  [ //表头
                  {field: 'testname', title: '试卷名称',fixed: 'left'}
                  ,{field: 'scores', title: '试卷总分' }
                  ,{field: 'sum', title: '总人数', sort: true}
                  ,{field: 'average', title: '平均分' }
                  ,{field: 'passrate', title: '及格率'}
              ]]
          });

      });
  </script>
</body>
</html>